package com.acme.service.bank.impl;

import com.acme.domain.client.Bank;
import com.acme.service.bank.BankReportPresentationService;
import com.acme.service.bank.BankReportService;

public class ConsoleBankReportPresentationService implements
	BankReportPresentationService {
    private BankReportService bankReportService;

    @Override
    public void printAccountsSortedByDeposit(final Bank bank,
	    final boolean ascending) {
	System.out
		.println("Accounts sourted by deposit("
			+ (ascending ? "ascending" : "descending")
			+ "): \n"
			+ bankReportService.getAccountsSortedByDeposit(bank,
				ascending));
    }

    @Override
    public void printBankCredit(final Bank bank) {
	System.out.println("Bank credit: "
		+ bankReportService.getBankCredit(bank));
    }

    @Override
    public void printClientsAccounts(final Bank bank) {
	System.out.println("Clients and there accounts: \n"
		+ bankReportService.getCustomerAccounts(bank));
    }

    @Override
    public void printNumberOfClients(final Bank bank) {
	System.out.println("Number of bank clients: "
		+ bankReportService.getNumberOfAccounts(bank));
    }

    @Override
    public void printNumberOfOpenedAccounts(final Bank bank) {
	System.out.println("Number of opened accounts: "
		+ bankReportService.getNumberOfOpenAccounts(bank));
    }

    @Override
    public void setBankReportService(final BankReportService bankReportService) {
	this.bankReportService = bankReportService;
    }

}
